#ifndef _MYFILESYSTEM_H_
#define _MYFILESYSTEM_H_
#include "LinkTree.h"
#include <cstring>

struct FileInfo
{
    std::string name;
    std::string fileSize;
};

class MyFileSystem
{
public:
    MyFileSystem(const std::string& path);
    static void Print(void*p);
    static void Free(void*p);
    static bool Compare(void*p1,void*p2);
    void show()
    {
        tree.show();
    }

    void SetFunc()
    {
        tree.SetPrint(Print);
        tree.SetFree(Free);
        tree.SetCompare(Compare);
    }
    void FindByFileName(const std::string &name);
    
private:
    void ExploreDir(TreeNode *parent, FileInfo* path);
    LinkTree tree;
};

#endif